package cn.wolfcode.consumer._05_message_filter.sql92;

import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.annotation.SelectorType;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@Component
@RocketMQMessageListener(
        topic = "filter",
        consumerGroup = "boot-filter",
        selectorType = SelectorType.SQL92,//过滤的规则
        selectorExpression = "age > 18"
)
public class SqlFilter implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        System.out.println("sql 消息的内容为:" + message);
    }
}
